"""sync"""
import logging as log

from src.common.clients import GitCodeClient


class GitCodeSyncer:
    """GitCode 数据同步服务"""

    def __init__(self, repo_name, owner, client=None):
        self.repo_name = repo_name
        self.owner = owner
        self.client = client or GitCodeClient()

    def _init_issue(self, detail):
        """映射 API 数据到 Issue 模型"""

    def sync_issues(self):
        """同步指定仓库的 Issue 数据"""
        issues = self.client.get_repo_issues(self.owner, self.repo_name)
        print('****', issues)

    def full_sync(self):
        self.sync_issues()
